package com.example.idachuappone.index.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class HotServiceItemDetail implements Serializable {
    private String bespeak_info;
    private String bespeak_num;
    private String first_img;
    private List<String> flow;
    private String head;
    private String id;
    private List<FamilyFeastImgs> imgs;
    private String name;
    private String people_num;
    private String price;
    private List<FamilyFeastRecipes> recipes;
    private String slogan;

    public void parseJson(JSONObject json) {
        if (json != null) {
            JSONArray jsonArray;
            int i;
            if (json.has("id")) {
                this.id = json.optString("id");
            }
            if (json.has("name")) {
                this.name = json.optString("name");
            }
            if (json.has("slogan")) {
                this.slogan = json.optString("slogan");
            }
            if (json.has("price")) {
                this.price = json.optString("price");
            }
            if (json.has("bespeak_info")) {
                this.bespeak_info = json.optString("bespeak_info");
            }
            if (json.has("people_num")) {
                this.people_num = json.optString("people_num");
            }
            if (json.has("bespeak_num")) {
                this.bespeak_num = json.optString("bespeak_num");
            }
            if (json.has("head")) {
                this.head = json.optString("head");
            }
            if (json.has("first_img")) {
                this.first_img = json.optString("first_img");
            }
            if (json.has("flow")) {
                jsonArray = json.optJSONArray("flow");
                List<String> list = new ArrayList();
                for (i = 0; i < jsonArray.length(); i++) {
                    list.add(jsonArray.optString(i));
                }
                this.flow = list;
            }
            if (json.has("imgs")) {
                this.imgs = new ArrayList();
                try {
                    jsonArray = json.getJSONArray("imgs");
                    for (i = 0; i < jsonArray.length(); i++) {
                        this.imgs.add(new FamilyFeastImgs().parseJson(jsonArray.getJSONObject(i)));
                    }
                } catch (JSONException e) {
                    e.printStackTrace();
                }
            }
            if (json.has("recipes")) {
                this.recipes = new ArrayList();
                try {
                    jsonArray = json.getJSONArray("recipes");
                    for (i = 0; i < jsonArray.length(); i++) {
                        this.recipes.add(new FamilyFeastRecipes().parseJson(jsonArray.getJSONObject(i)));
                    }
                } catch (JSONException e2) {
                    e2.printStackTrace();
                }
            }
        }
    }

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSlogan() {
        return this.slogan;
    }

    public void setSlogan(String slogan) {
        this.slogan = slogan;
    }

    public String getPrice() {
        return this.price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public String getBespeak_info() {
        return this.bespeak_info;
    }

    public void setBespeak_info(String bespeak_info) {
        this.bespeak_info = bespeak_info;
    }

    public String getPeople_num() {
        return this.people_num;
    }

    public void setPeople_num(String people_num) {
        this.people_num = people_num;
    }

    public String getBespeak_num() {
        return this.bespeak_num;
    }

    public void setBespeak_num(String bespeak_num) {
        this.bespeak_num = bespeak_num;
    }

    public String getHead() {
        return this.head;
    }

    public void setHead(String head) {
        this.head = head;
    }

    public String getFirst_img() {
        return this.first_img;
    }

    public void setFirst_img(String first_img) {
        this.first_img = first_img;
    }

    public List<String> getFlow() {
        return this.flow;
    }

    public void setFlow(List<String> flow) {
        this.flow = flow;
    }

    public List<FamilyFeastImgs> getImgs() {
        return this.imgs;
    }

    public void setImgs(List<FamilyFeastImgs> imgs) {
        this.imgs = imgs;
    }

    public List<FamilyFeastRecipes> getRecipes() {
        return this.recipes;
    }

    public void setRecipes(List<FamilyFeastRecipes> recipes) {
        this.recipes = recipes;
    }
}
